package com.zlp.mall.portal.controller;


import com.zlp.mall.common.api.R;
import com.zlp.mall.portal.modules.pms.dto.resp.ProductDetailResp;
import com.zlp.mall.portal.modules.pms.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 商品信息 前端控制器
 * </p>
 *
 * @author ZouLiPing
 * @since 2021-09-23
 */
@RestController
@RequestMapping("/product")
@RequiredArgsConstructor
@Api(value = "ProductController", tags = "商品模块")
public class ProductController {

    private final ProductService productService;


    @GetMapping("/detail/{id}")
    @ApiOperation(value = "获取商品详情获")
    public R<ProductDetailResp> getProductDetail(
            @PathVariable(value = "id") @ApiParam(name = "id", value = "ID") Long id
    ) {
        ProductDetailResp productResp = productService.getProductDetail(id);
        return R.success(productResp);
    }



}

